var util = require('../../utils/util')
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    id:0,
    order: {
      id: '',
      status: '',
      time: '',
      goods: [],
      postPrice: 0,
      totalPrice: '0',
      recever: '',
      phone: '',
      addrDetail: '',
      remarks:'' 
    }
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    let order = JSON.parse(options.order)
    console.log(order);
    this.setData({
      id:parseInt(order.id),
      totalPostage: order.totalPostage
      })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {
    let that = this
    console.log('传参'+that.data.order.id)
    util.post({
      url:"https://groomtea.icebartech.com/api/miniApp/order/orderDetail",
      header: { 'content-type': 'application/x-www-form-urlencoded' },
      dataForm:{
        id:that.data.id
      },
      success:(res)=>{
        console.log(res)
        that.setData({order:res.data.bussData})
      }
    })
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  }
})